<?php
/**
*   区块类别模型
 *  author：yuchong
 *  date:20150503
 */

class Section_model extends MY_Model {
	
	public function __construct() {
		parent::__construct();
        $this->_table = "db_section";
	}

    /**
     *  获取单个栏目内容
     *  $cid   int    区块栏目id
    *   reutrn array
     */
    public function getByCid($cid = null){
        if($cid){
            return $this->db->from($this->_table)->where('classid', $cid)->order_by('sort desc')->get()->result_array();
        }
        return false;
    }

    /**
    *   获取单个区块id的内容
     *  $sid int 区块id
     *  reuturn array
     */
    public function getBySid($sid = null){
        if($sid){
            return  $this->db->from($this->_table)->where('sectionid', $sid)->get()->row_array();
        }
        return false;
    }






}

?>
